<template>
	<view class="main">
		<Head></Head>
		<view class="main-div">
			<view class="top-titile">
				基本信息
			</view>
		</view>
		<view class="main-top">
			<view class="top-bottom">
				<u-cell-group :border="false">
					<u-cell arrow-direction="down">
						<view class="down-cell" slot="title">
							<view class="cell-title">护理等级</view>
							<view class="cell-title1" v-if="listObj.CARETYPE">{{listObj.CARETYPE}}级护理</view>
							<view class="cell-title1" v-else></view>
						</view>
					</u-cell>
					<u-cell>
						<view class="down-cell" slot="title">
							<view class="cell-title">药物过敏</view>
							<view class="cell-title1">{{listObj.GM}}</view>
						</view>
					</u-cell>
					<u-cell>
						<view class="down-cell" slot="title">
							<view class="cell-title titles">饮食</view>
							<view class="cell-title1">{{listObj.FOOD}}</view>
						</view>
					</u-cell>
					<u-cell>
						<view class="down-cell cell-grou" slot="title">
							<view class="cell-title titles">性别</view>
							<view class="cell-title1">{{listObj.PSEX}}</view>
						</view>
						<view class="down-cell" style="flex: 0.8;" slot="value">
							<view class="cell-title">年龄</view>
							<view class="cell-title1">{{listObj.AGE}}</view>
						</view>
					</u-cell>
					<u-cell>
						<view class="down-cell cell-grou" slot="title">
							<view class="cell-title titles">科室</view>
							<view class="cell-title1">{{listObj.DEPTNAME}}</view>
						</view>
					</u-cell>
					<u-cell title="主治医生">
						<view class="down-cell cell-grou" slot="title">
							<view class="cell-title">主治医生</view>
							<view class="cell-title1">{{listObj.DRNAME}}</view>
						</view>
					</u-cell>
					<u-cell>
						<view class="down-cell cell-grou" slot="title">
							<view class="cell-title">入院时间</view>
							<view class="cell-title1">{{listObj.ADMID}}</view>
						</view>
					</u-cell>
					<u-cell>
						<view class="down-cell cell-grou" slot="title">
							<view class="cell-title">入院诊断</view>
							<view class="cell-title1">{{listObj.DIAG}}</view>
						</view>
					</u-cell>
					<u-cell>
						<view class="down-cell cell-grou" slot="title">
							<view class="cell-title">医保类型</view>
							<view class="cell-title1">{{listObj.SERVICENAME}}</view>
						</view>
					</u-cell>
					<u-cell>
						<view class="down-cell cell-grou" slot="title">
							<view class="cell-title">费用总计</view>
							<view class="cell-title1">{{listObj.ZFY}}</view>
						</view>
					</u-cell>
					<u-cell>
						<view class="down-cell cell-grou" slot="title">
							<view class="cell-title titles">预交款</view>
							<view class="cell-title1">{{listObj.YJK}}</view>
						</view>
						<view class="down-cell" style="flex: 0.8;" slot="value">
							<view class="cell-title">余额</view>
							<view class="cell-title1">{{listObj.YE}}</view>
						</view>
					</u-cell>
					<u-cell title="手术日期" :border="false">
						<view class="down-cell cell-grou" slot="title">
							<view class="cell-title">手术日期</view>
							<view class="cell-title1">{{listObj.PLANDATE}}</view>
						</view>
					</u-cell>
				</u-cell-group>
			</view>
		</view>
			<suspension-ball :isShow="false" @tap.native="jampBall"></suspension-ball>
	</view>
</template>

<script>
	import Head from '../../components/html/head.vue'
	import {
		Ward_GetPatBedNurseCard
	} from '../../api/user.js'
	import {
		mapMutations,
		mapState
	} from "vuex";
		import suspensionBall from '../../components/html/xuanfuqiu.vue'
	export default {
		components: {
			Head,
			suspensionBall
		},
		data() {
			return {
				show: false,
				form: {
					name: '',

				},
				listObj: {},
				wjdhObj: {}
			};
		},
		watch: {
			deleteObj: {
				// deep: true,
				handler(newval) {
					console.log(newval);
					this.Ward_GetPatBedNurseCardFun()
				},
			}
		},
		computed: {
			...mapState('user', ["userInfo", "deleteObj"]),

		},
		onLoad() {
			this.Ward_GetPatBedNurseCardFun()
		},
		methods: {
			jampBall() {
				uni.navigateBack({
					delta: 1, //返回层数，2则上上页
				})
			},
			async Ward_GetPatBedNurseCardFun() {
				uni.showToast({
					title: '加载中...', //显示的文字
					duration: 2000, //显示多少时间，默认1500毫秒
					icon: "loading", //自定义显示的图标，默认成功success，错误error,加载loading，不显示图标是none
					mask: true
				})
				try {
					const OBJ = uni.getStorageSync('deleteObj');
					const userInfo = uni.getStorageSync('userInfo')
					let data = {
						HosKind: userInfo.hoscode,
						sType: '',
						sParm1: OBJ.MRN,
						sParm2: OBJ.SERIES,
						sOperdept: userInfo.HosKind,
						sOperJp: userInfo.sPassword
					}
					const res = await this.$http.Ward_GetPatBedNurseCard(data)
					if (res) {
						res[0].CARETYPE = res[0].CARETYPE == '0' ? '特' : res[0].CARETYPE == '1' ? '一' : res[0]
							.CARETYPE == '2' ? '二' : res[0].CARETYPE == '3' ? '三' : '',
							res[0].PSEX = res[0].PSEX == 'F' ? '女' : '男',
							this.listObj = res[0]
					} else {
						this.listObj = {}
					}
					await uni.hideToast();
				} catch (e) {
					console.log(e);
					//TODO handle the exception
				}

			}
		}
	};
</script>

<style scoped lang="scss">
	.main {
		width: 100%;
		height: 100%;
		background: #F9F9F9;
		position: relative;
	}

	.main-div {
		width: 100%;
		height: 106px;
		background: url('../../static/img/essential.png')no-repeat;
		background-size: 100% auto;
		position: relative;
	}

	.main-top {
		// width: 95%;
		/* height: 533px; */
		width: 95.5%;
		background: #B0E9EC;
		/* box-shadow: 0px 1px 8px 0px #d4d9d9; */
		// position: absolute;
		margin: -60px auto 0;
		padding: 6rpx 0 10rpx;
		// top: 144px;
		// left: 12px;
		border-radius: 6px;
		z-index: 5;
		// background: url('../../static/img/essential.png') no-repeat;
		// background-size: 100% auto;
	}

	.top-titile {
		font-size: 16px;
		font-family: SourceHanSansCN-Medium, SourceHanSansCN;
		font-weight: 500;
		color: #333333;
		line-height: 24px;
		width: 93%;
		margin: 0 auto;
		padding: 17px 0 0 0;
	}

	.top-bottom {
		// height: 489px;
		background: #F6FEFF;
		border-radius: 6px;
		opacity: 0.95;
		width: 97%;
		margin: 0 auto;
		// margin: 0px 14px;

		.down-cell {
			display: flex;
			align-items: center;

			.titles {
				text-align-last: justify;
				text-align: justify;
				text-justify: inter-ideograph;
				width: 64px;
			}

			.cell-title {
				font-size: 16px;
				font-family: SourceHanSansCN-Normal, SourceHanSansCN;
				font-weight: 400;
				color: #9F9F9F;
				line-height: 24px;
				padding-left: 6px;
				white-space: nowrap;
			}

			.cell-title1 {
				margin-left: 24px;
				font-size: 16px;
				font-family: SourceHanSansCN-Medium, SourceHanSansCN;
				font-weight: 500;
				// color: #008FE2;
				line-height: 24px;
			}
		}
	}

	::v-deep .u-cell-group {
		padding: 0 10px;

		.u-cell__body {
			padding: 16rpx 0rpx !important;
		}
	}
</style>
